/**
 * 
 */
package cn.edu.cqu.bysj.wm.gui.component;

import javax.swing.JPanel;
import javax.swing.JTextPane;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.SystemColor;
import javax.swing.border.LineBorder;

/**
 * @author Meng
 * 
 */
public class GlobalKeyNodeTabContent extends JPanel {
	private JPanel panel;
	private JTextPane keyNodeSet;
	private JTextPane Spearman;
	private JLabel lblSpearman;
	private JPanel panel_2;

	public JPanel getPanel() {
		return panel;
	}

	public void setPanel(JPanel panel) {
		this.panel = panel;
	}

	public JTextPane getKeyNodeSet() {
		return keyNodeSet;
	}

	public void setKeyNodeSet(JTextPane keyNodeSet) {
		this.keyNodeSet = keyNodeSet;
	}

	/**
	 * create global key node tab content
	 */
	public GlobalKeyNodeTabContent() {

		panel = new JPanel();
		panel.setToolTipText("各项指标排序");
		panel.setBackground(UIManager.getColor("CheckBox.background"));

		JPanel panel_1 = new JPanel();
		panel_1.setForeground(UIManager.getColor("Button.shadow"));
		panel_1.setBorder(new LineBorder(UIManager.getColor("Button.shadow")));

		panel_2 = new JPanel();
		panel_2.setForeground(UIManager.getColor("Button.shadow"));
		panel_2.setBorder(new LineBorder(UIManager.getColor("Button.shadow")));
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addComponent(panel, GroupLayout.DEFAULT_SIZE, 877, Short.MAX_VALUE)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(panel_2, GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)))
					.addGap(0))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(groupLayout.createSequentialGroup()
					.addComponent(panel, GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addComponent(panel_2, GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)
						.addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE))
					.addContainerGap())
		);

		setSpearman(new JTextPane());
		getSpearman().setBackground(SystemColor.menu);
		getSpearman().setEditable(false);
		GroupLayout gl_panel_2 = new GroupLayout(panel_2);
		gl_panel_2.setHorizontalGroup(
			gl_panel_2.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_2.createSequentialGroup()
					.addGap(102)
					.addComponent(lblSpearman, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
					.addGap(135))
				.addGroup(gl_panel_2.createSequentialGroup()
					.addContainerGap()
					.addComponent(Spearman, GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE)
					.addGap(28))
		);
		gl_panel_2.setVerticalGroup(
			gl_panel_2.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_panel_2.createSequentialGroup()
					.addComponent(lblSpearman, GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(Spearman, GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)
					.addGap(16))
		);
		panel_2.setLayout(gl_panel_2);

		JLabel lblNewLabel = new JLabel("全局关键节点");
		lblNewLabel.setForeground(new Color(50, 205, 50));

		keyNodeSet = new JTextPane();
		keyNodeSet.setForeground(new Color(0, 0, 0));
		keyNodeSet.setEditable(false);
		keyNodeSet.setBackground(SystemColor.menu);
		GroupLayout gl_panel_1 = new GroupLayout(panel_1);
		gl_panel_1.setHorizontalGroup(
			gl_panel_1.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_1.createSequentialGroup()
					.addGap(145)
					.addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 178, Short.MAX_VALUE)
					.addGap(168))
				.addGroup(gl_panel_1.createSequentialGroup()
					.addContainerGap()
					.addComponent(keyNodeSet, GroupLayout.DEFAULT_SIZE, 463, Short.MAX_VALUE)
					.addContainerGap())
		);
		gl_panel_1.setVerticalGroup(
			gl_panel_1.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_panel_1.createSequentialGroup()
					.addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(keyNodeSet, GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
					.addContainerGap())
		);
		panel_1.setLayout(gl_panel_1);
		panel.setLayout(new BorderLayout(0, 0));
		setLayout(groupLayout);
	}

	public JTextPane getSpearman() {
		return Spearman;
	}

	public void setSpearman(JTextPane spearman) {

		lblSpearman = new JLabel("spearman相关系数");
		lblSpearman.setForeground(new Color(65, 105, 225));
		Spearman = spearman;
		Spearman.setForeground(new Color(0, 0, 0));
	}
}
